/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bungabungaball.gamestates.menu;

import org.newdawn.slick.Font;

/**
 * A entry for the menu.
 *
 * @author Ingo Klose, Stephan Meyer, Sebastian Lehmann
 * @version 1.0
 */
public class MenuEntry {

    /**
     * Position x
     */
    public int x;
    /**
     * Position y
     */
    public int y;
    /**
     * The text of the entry
     */
    public String text;
    /**
     * The width of the entry
     */
    public int w;
    /**
     * The hight of the text
     */
    public int h;

    /**
     * Constructor
     */
    public MenuEntry() {
        x = y = h = w = 0;
        text = "";
    }

    /**
     * Constructor
     *
     * @param t
     * @param setY
     * @param setX
     * @param f
     */
    public MenuEntry(String t, int setX, int setY, Font f) {
        x = setX;
        y = setY;
        text = t;
        h = f.getLineHeight();
        w = f.getWidth(text);

    }

    /**
     * Check if the mouse if over the entry
     *
     * @param mouseX
     * @param mouseY
     * @return if the mouse if over the entry
     */
    public Boolean checkMouseIn(int mouseX, int mouseY) {
        return (mouseX > x && mouseX < x + w && mouseY > y && mouseY < y + h);

    }

    /**
     * Make a pause after a click on the entry
     */
    public static final void clickPause() {
        try {
            Thread.sleep(100);
        } catch (InterruptedException ex) {
            //Logger.getLogger(MenuOptionSTATE.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
